package com.hh.flow.enums;

/**
 * @description:  结点类型
 * @author minliuhua
 * @date: 2023/3/31 12:16
 */
public enum NodeType {
	start(0,"start"),
	between(1,"between"),
	end(2,"end");

	private Integer key;
	private String value;

	private NodeType(Integer key, String value)
	{
		this.key = key;
		this.value = value;
	}

	public Integer getKey()
	{
		return key;
	}

	public String getValue()
	{
		return value;
	}

	public static Integer getKeyByValue(String value)
	{
		for (NodeType item : NodeType.values())
		{
			if (item.getValue().equals(value))
			{
				return item.getKey();
			}
		}
		return null;
	}

	public static String getValueByKey(Integer key)
	{
		for (NodeType item : NodeType.values())
		{
			if (item.getKey().equals(key))
			{
				return item.getValue();
			}
		}
		return null;
	}
}
